package com.kaifamiao.ioc.creation;

import org.springframework.beans.factory.FactoryBean;

import java.time.LocalDate;

public class LocalDateFactoryBean implements FactoryBean<LocalDate> {

    private int year;
    private int month;
    private int date;

    @Override
    public LocalDate getObject() throws Exception {
        return LocalDate.of( year, month, date );
    }

    @Override
    public Class<?> getObjectType() {
        return LocalDate.class;
    }

    public int getYear() {
        return year;
    }

    public void setYear(int year) {
        this.year = year;
    }

    public int getMonth() {
        return month;
    }

    public void setMonth(int month) {
        this.month = month;
    }

    public int getDate() {
        return date;
    }

    public void setDate(int date) {
        this.date = date;
    }
}
